package org.example.maven.service.Impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.example.maven.api.client.ActionCommonClient;
import org.example.maven.mapper.ActionMapper;
import org.example.maven.pojo.action.ActionListAdd;
import org.example.maven.pojo.action.ActionOrderList;
import org.example.maven.service.ActionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ActionServiceImpl extends ServiceImpl<ActionMapper, ActionListAdd> implements ActionService {

    @Autowired
    private ActionCommonClient actionCommonClient;

    @Override
    public List<ActionOrderList> getAllOrderList(int id) {
        return baseMapper.getAllOrderList(id);
    }

    @Override
    public void addAction(ActionListAdd actionListAdd) {
        baseMapper.insert(actionListAdd);
        actionCommonClient.addExhibition(actionListAdd);
    }
}
